package com.zzyl.controller.manager;

import com.zzyl.base.PageBean;
import com.zzyl.base.ResponseResult;
import com.zzyl.service.MemberService;
import com.zzyl.vo.MemberVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@Api(tags = "客户管理相关接口")
@RestController
@RequestMapping("/c-user")
public class CustomerController {

    @Resource
    private MemberService memberService;


    @ApiOperation(value = "分页查询客户信息", notes = "根据页码、每页数量、手机号、昵称分页查询客户信息")
    @GetMapping("page")
    public ResponseResult<PageBean<MemberVo>> page(Integer pageNum,
                                                   Integer pageSize,
                                                   String phone,
                                                   String nickname) {
        PageBean<MemberVo> pageBean = memberService.page(pageNum, pageSize, phone, nickname);
        return ResponseResult.success(pageBean);
    }
}
